-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InstanceOfPatternMatch: Generic type without parameters #298
InstanceOfPatternMatch: Generic type without parameters #298
Conversation
oldTypeTree.withPrefix(Space.EMPTY), | ||
null, | ||
oldTypeTree.getType() | ||
).withTypeParameters(fqType.getTypeParameters().stream().map(p -> new J.Wildcard(randomId(), Space.EMPTY, Markers.EMPTY, null, null)).collect(Collectors.toList()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self : look at listutils to conform with code elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListUtil.map()
is for the same type lists, i.e. mapping of List<J>
-> List<J>
in my case it is List<JavaType>
-> List<J>
. I felt it is okay... the list can't be long... I only care about its size. If there are 5 type parameters i wanted to produce <?,?,?,?,?>
. I can rerwrite this piece to conform to what i mentioned above better rather than have map
Thanks a lot for the thorough fix here! I'm still at Spring IO, but will merge this when not reviewing on mobile. :) |
Thanks a lot for the immediate fix @BoykoAlex ! |
Unit test and a possible straight-forward fix for
InstanceOfPatternMatch
recipe produces compiler error with generic types without type parameters #297